(const :tag "In the first line" top)
(const :tag "In the last line" bottom)
(const :tag "In the echo area" echo)
+ (const :tag "In the mode-line" mode-line)
(const :tag "Hide" nil)))
(defcustom which-key-popup-type 'side-window
nil))
(`echo
(cons page
- (concat full-prefix (when prefix-keys " ")
- status-line (when status-line " ")
- nxt-pg-hint)))
+ (lambda ()
+ (which-key--echo
+ (concat full-prefix (when prefix-keys " ")
+ status-line (when status-line " ")
+ nxt-pg-hint)))))
+ (`mode-line
+ (cons page
+ (lambda ()
+ (with-current-buffer which-key--buffer
+ (setq-local mode-line-format
+ (concat " " full-prefix " " status-line " " nxt-pg-hint))))))
(_ (cons page nil)))))
(defun which-key--show-page (n)
(if (= 0 n-pages)
(message "%s- which-key can't show keys: There is not \
enough space based on your settings and frame size." prefix-keys)
- (setq page-n (mod n n-pages)
- which-key--current-page-n page-n)
+ (setq page-n (mod n n-pages))
+ (setq which-key--current-page-n page-n)
(when (= n-pages (1+ n)) (setq which-key--on-last-page t))
(let ((page-echo (which-key--process-page page-n which-key--pages-plist))
(height (plist-get which-key--pages-plist :page-height))
(erase-buffer)
(insert (car page-echo))
(goto-char (point-min)))
- (when (cdr page-echo) (which-key--echo (cdr page-echo)))
+ (when (cdr page-echo) (funcall (cdr page-echo)))
(which-key--show-popup (cons height width)))))
;; used for paging at top-level
(if (fboundp 'set-transient-map)